package com.example.demo.realm;


import org.apache.shiro.authc.AuthenticationException;
import org.apache.shiro.authc.AuthenticationInfo;
import org.apache.shiro.authc.AuthenticationToken;
import org.apache.shiro.authc.SimpleAuthenticationInfo;
import org.apache.shiro.authc.UsernamePasswordToken;
import org.apache.shiro.realm.Realm;

/**
 * @author Henry.Y
 * @date 2019-05-24
 */
public class MyRealm1 implements Realm{

	public String getName(){
		
		return "a";
	}
	
	public boolean supports(AuthenticationToken token){
		
		return token instanceof UsernamePasswordToken;
	}
	
	public AuthenticationInfo getAuthenticationInfo(AuthenticationToken token)throws AuthenticationException{
		
		return new SimpleAuthenticationInfo("zhang","123",getName());
	}
}
